package com.caiyouxi.goods.controller;

import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.common.control.BaseController;
import com.caiyouxi.goods.model.GoodsPropertiesConfig;
import com.caiyouxi.goods.service.GoodsPropertiesConfigService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Administrator on 2017/11/9.
 */
@RestController
@RequestMapping("/boss/goods_properties_config")
public class GoodsPropertiesConfigController  extends BaseController{

    private Logger logger = Logger.getLogger(GoodsPropertiesConfigService.class);

    @Autowired
    private GoodsPropertiesConfigService goodsPropertiesConfigService;

    /**
     * 查询商品或订单的扩展属性配置
     */
    @RequestMapping("get_goods_properties_config_info")
    public ResData get_goods_properties_config_info(HttpServletRequest request, HttpServletResponse response, @RequestBody GoodsPropertiesConfig goodsPropertiesConfig){
        logger.info("=============================== 查询商品或订单的扩展属性配置 ================================");
        return goodsPropertiesConfigService.get_goods_properties_config_info(goodsPropertiesConfig);
    }

    /**
     * 查询商品或订单的扩展属性配置列表
     */
    @RequestMapping("/get_goods_properties_config_list")
    public ResData get_goods_properties_config_list(HttpServletRequest request,HttpServletResponse response,@RequestBody GoodsPropertiesConfig goodsPropertiesConfig){
        logger.info("=============================== 查询商品或订单的扩展属性配置列表================================");
        return goodsPropertiesConfigService.get_goods_properties_config_list(goodsPropertiesConfig);
    }

    /**
     * 新增商品或订单的扩展属性配置
     */
    @RequestMapping("add_goods_properties_config")
    public ResData add_goods_properties_config(HttpServletRequest request,HttpServletResponse response,@RequestBody GoodsPropertiesConfig goodsPropertiesConfig){
        logger.info("=============================== 新增商品或订单的扩展属性配置 ================================");
        return goodsPropertiesConfigService.add_goods_properties_config(goodsPropertiesConfig);
    }

    /**
     * 修改商品或订单的扩展属性配置
     */
    @RequestMapping("update_goods_properties_config")
    public ResData update_goods_properties_config(HttpServletRequest request,HttpServletResponse response,@RequestBody GoodsPropertiesConfig goodsPropertiesConfig){
        logger.info("=============================== 修改商品或订单的扩展属性配置 ================================");
        return  goodsPropertiesConfigService.update_goods_properties_config(goodsPropertiesConfig);
    }

    /**
     * 删除商品或订单的扩展属性配置
     */
    @RequestMapping("delete_goods_properties_config")
    public ResData delete_goods_properties_config(HttpServletRequest request,HttpServletResponse response,@RequestBody GoodsPropertiesConfig goodsPropertiesConfig){
        logger.info("===============================删除商品或订单的扩展属性配置 ================================");
        return goodsPropertiesConfigService.delete_goods_properties_config(goodsPropertiesConfig) ;
    }






}
